<?php
/**
 * Pertyler DatabaseManagement
 * DatabaseModel
 * Column Abstract Classes
 *
 * @author	Emre Hasegeli <hasegeli@gmail.com>
 * @license	GNU General Public License v3
 */

namespace Pertyler;

abstract class aColumn
{
	private $parent;

	private $priority;

	private $name;

	private $backgroundName;

	private $columnType;

	private $relatedTable;

	public function __Construct($priority,
			$name,
			$backgroundName,
			$columnType,
			$relatedTable)
	{
		$this->priority = $priority;

		$this->name = $name;

		$this->backgroundName = $backgroundName;

		$this->columnType = $columnType;

		$this->relatedTable = $relatedTable;
	}

	public function Priority()
	{
		return $this->priority;
	}

	public function __ToString()
	{
		return $this->name;
	}

	public function BackgroundName()
	{
		return $this->backgroundName;
	}

	public function ColumnType()
	{
		return $this->columnType;
	}

	public function RelatedTable()
	{
		return $this->relatedTable;
	}

	public function String()
	{
		if($this->ColumnType() == 'string')
			return true;

		if($this->ColumnType() == 'paragraph')
			return true;

		if($this->ColumnType() == 'text')
			return true;

		if($this->ColumnType() == 'email')
			return true;

		if($this->ColumnType() == 'webSite')
			return true;
	}

	public function Numeric()
	{
		if($this->ColumnType() == 'integer')
			return true;

		if($this->ColumnType() == 'float')
			return true;
	}

	public function Date()
	{
		if($this->ColumnType() == 'date')
			return true;

		if($this->ColumnType() == 'time')
			return true;
	}

	public function Boolean()
	{
		if($this->ColumnType() == 'boolean')
			return true;
	}
}
